package com.koron.ticket.work.workticket.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.koron.bean.query.PageQuery;
import com.koron.common.core.config.ThreadLocalContext;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
public class WorkTicketQuery extends PageQuery {

    @ApiModelProperty(value = "ID")
    private String id;

    @ApiModelProperty(value = "工作票票号")
    private String code;

    @ApiModelProperty(value = "工单编号")
    private String orderCode;

    @ApiModelProperty(value = "工单类型")
    private String orderType;

    @ApiModelProperty(value = "工单id")
    private String orderId;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "工作票类型,来源数据字典，两票管理-ticket_work_type")
    private String type;

    @ApiModelProperty(value = "工作票类型,来源数据字典，两票管理-ticket_work_type")
    private List<String> types;

    @ApiModelProperty(value = "开票人所在单位id")
    private String unit;

    @ApiModelProperty(value = "开票人所在单位名称")
    private String unitName;

    @ApiModelProperty(value = "工作负责人account")
    private String director;

    @ApiModelProperty(value = "工作负责人名称")
    private String directorName;

    @ApiModelProperty(value = "工作班组名称列表")
    private String team;

    @ApiModelProperty(value = "工作负责人账号列表")
    private List<String> directorList;

    @ApiModelProperty(value = "工作地点id")
    private String location;

    @ApiModelProperty(value = "工作地点名称")
    private String locationName;

    @ApiModelProperty(value = "预计开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date estimatedStartTime;

    @ApiModelProperty(value = "预计结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date estimatedEndTime;

    @ApiModelProperty(value = "工作内容")
    private String content;

    @ApiModelProperty(value = "工作票状态，来源数据字典，两票管理-ticket_work_status")
    private Integer status;

    @ApiModelProperty(value = "工作票状态列表，用于分页查询")
    private List<Integer> statusList;

    @ApiModelProperty(value = "外单位标志,0：本单位;1：外单位")
    private Integer externalFlag;

    @ApiModelProperty(value = "填票开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date startCreateTime;

    @ApiModelProperty(value = "填票结束结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date endCreateTime;

    @ApiModelProperty(value = "抽查结果 0 不合格、1合格、2未抽查")
    private Integer checkResults;

    @ApiModelProperty(value = "当前用户预览范围")
    private List<String> units;

    private String createBy = ThreadLocalContext.get().getAccount();

    public WorkTicketQuery() {
    }

    public WorkTicketQuery(String id) {
        this.id = id;
    }
}
